def logger(func):
    def wrapper(*args,**kwargs):
        print('函数执行了')
        result = func(*args,**kwargs)
        print('函数执行完了')
        return result
    return wrapper

@logger
def test():
    print('test')

if __name__ == '__main__':
    test()

    # newFunc = logger(test)
    # newFunc()
